<template>
  <div class="container">
    <div class="one" id="three-top-right-one">接口调用耗时TOP</div>
    <div class="three" id="three-top-right-header">
      <div class="header">
        <span class="span">接口号</span>
        <span class="span">接口名</span>
        <span class="span">调用耗时（s）</span>
        <span class="span">源端</span>
        <span class="span">目标端</span>
      </div>
      <div class="body son" v-for="(item, index) in dataList" :key="index">
        <span class="span">{{ item.interfaceCode }}</span
        ><span class="span">{{ item.interfaceName }}</span
        ><span class="span">{{ item.keepTime }}</span
        ><span class="span">{{ item.srcSystemName }}</span
        ><span class="span">{{ item.tarSystemName }}</span>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
// import { fontSize } from '../../utils/tools'
export default {
  name: 'oneBottomLeft',
  data () {
    return {
      dataList: []
    }
  },
  watch: {
    initData: {
      deep: true,
      handler (val) {
        // console.log('最后一个的数据检测到改变了')
        this.dataList = this.initData.interfaceCallTimeConsumingTop
      }
    }
  },
  mounted () {
    // this.setFontSize()
    this.dataList = this.initData.interfaceCallTimeConsumingTop
  },
  computed: {
    ...mapState(['initData'])
  },
  methods: {
    // setFontSize () {
    //   let banner = document.getElementById('three-top-right-one')
    //   banner.style.fontSize = `${fontSize(15)}px`
    //   let header = document.getElementById('three-top-right-header')
    //   header.style.fontSize = `${fontSize(5)}px`
    // }
  }
}
</script>

<style lang="less" scoped>
.container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: url('../../assets/image/width.png') no-repeat 0px 0px;
  background-size: 100% 100%;
  // background-color: rgb(132, 193, 218, 0.1);
  .one {
    width: 940px;
    height: 110px;
    display: flex;
    justify-content: start;
    align-items: center;
    padding-left: 10%;
    font-size: 35px;
    font-family: PingFangSC-Medium, PingFang SC;
    font-weight: 500;
    color: #66e2e2;
    background: url('../../assets/image/widthTipbg.png') no-repeat 0px 0px;
    background-size: 100% 100%;
  }
  .three {
    height: 700px;
    // border: 1px solid #000;
    margin-top: 25px;
    margin-right: 45px;
    margin-left: 45px;
    margin-bottom: 30px;
    color: white;
    .son {
      &:nth-child(odd) {
        background-color: #042e5d;
        // opacity: 0.4;
        font-size: 15px;
      }
      &:nth-child(even) {
        background-color: rgba(0, 20, 47, 0.64);
        // opacity: 1;
        font-size: 15px;
      }
    }

    .header {
      padding-left: 4%;
      padding-right: 4%;
      height: 70px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #042e5d;
      text-align: center;
      font-size: 20px;
      .span {
        // border: 1px solid #000;
        width: 18%;
      }
    }
    .body {
      padding-left: 4%;
      padding-right: 4%;
      height: 70px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      text-align: center;
      .span {
        // border: 1px solid #000;
        width: 18%;
      }
    }
  }
}
</style>
